#include  <cstdio>
#include  <iostream>
using namespace std;
#define     BULL	1
#define     BEAR	2

int main(int argc, char *argv[])
{
	int m,n,k;
	double d[10000];
	scanf("%d%d%d",&m,&n,&k);
	for( int i = 0; i < k ; ++i )
		scanf("%lf",&d[i]);
	double sm = 0,sn = 0;
	short pre;
	for( int i = n-1; i != -1 ; --i )
	{
		sn += d[i];
		if( i >= n - m)
			sm += d[i];
	}
	if(sm/m > sn/n)
	{
		printf("BUY ON DAY %d\n",n);
		pre = BULL;
	}
	else if(sm/m < sn/n)
	{
		printf("SELL ON DAY %d\n",n);
		pre = BEAR;
	}
	for( int i = n; i < k ; ++i )
	{
		sn -= d[i-n];
		sn += d[i];
		sm -= d[i-m];
		sm += d[i];
		if(sm/m > sn/n)
		{
			if(pre == BEAR)
				printf("BUY ON DAY %d\n",i+1);
			pre = BULL;
		}
		else if(sm/m < sn/n)
		{
			if(pre == BULL)
				printf("SELL ON DAY %d\n",i+1);
			pre = BEAR;
		}
	}
}
